Major restructuring of code (feature incomplete)

Fixed major errors in code, such as misuse of command line arguments.
However, this is still feature incomplete and is thus unusable in a
server. Documentation still needs to be done, as well as plugin.yml
stuff.