Added assertions and improved code readability as per #1.
Improved the code style (added constants, documentation, removed old code, etc) as per issue #1.
Removed all NSLog() calls. Closes #1.