I would approach management with the goal of defining a project with scope and requirements for this app, let them know that this first run was a "proof of concept" (if you have not made that point already) and that the application needs to be rewritten/restructured to be supportable/usable in the wild. After management approves the project, then sit down and re-factor -- my gut feeling on things like this is that if it was not meant to be production as it was written, it is usually easier to rewrite from scratch to bring it up to production quality.