tools.deploy.backend: rearranging the order of parameters in the deploy ...

Here is the fix so that deployment works with the new command line parsing. I also added tests because tests are nice. :)