Major refactoring. All commands are now sent through websockets. Fixes #1