Uses $document instead of document
Allows for custom socket.io & api addresses

This allows you to run the front end on a separate host than the bot &
api