Whitespace changes.
Improved debug logging and documentation of code.
Fix strcmp and other small changes
Merge pull request #4 from samwho/master

Documentation, changes the malloc prototype, logging