Moved most commands to their own functions
Fix typo in help message.
Various fixes for cleanup, fix a bug where changing a password didn't actually run a successful DB query.
Code cleanup (tentatively) finished. Some bugs may still exist.
Merge branch 'master' into cleanup