Lots of little cleanup

So...I did make a couple of changes. Most of it is to make the code a bit more readable as well as bring it up to date with the gradle build system.

I do suggest, that if you accept the pull request, to make sure everything still works as you intend it to. I've been using my own build for the past couple of days and everything seems to be working fine. Let me know if you have any questions.

Thanks for the project, it's given me something to do the past couple of days :D