Removed a bunch of magical constants. Added some javadocs.