Implements stage deployement and cleans up other stage code; adds tests

I'm concerned about format_url being called in the tests. When you switch to using django forms for validating the user input this code will probably go away and all the tests will have to change.