having the ejabberd authentication script connect to the userappserver at the DB IP address, and not at the login address (which can differ in advanced deployments)
only scaling apps down if they are currently hosted
moved app lock to include all of remove_app
also guarding on scaling up
Merge pull request #367 from shatterednirvana/guards-on-scale-down

only scaling apps down if they are currently hosted
Merge pull request #366 from shatterednirvana/xmpp-in-advanced-deployment

Having the ejabberd authentication script connect to the userappserver