Added a constants header.

Made the code slightly less unsightly but there's still MUCH to be done.
Added some comments and removed some of the  superfluous ones.