Major refactor and cleanup

First post-modjam editing.