starting a major refactoring and cleanup of code base because I hope to eventually make this into a nice and legit project, not just a fast hack. This will take a while...