Code cleanup and works with ant

After Jacob went Maven all over the project, I've rescued the ant
infrastructure as well.

Also re-indented some things.