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

That's fine.  That will happen later.