Added more tests. Fixed up the documentation. Minor refactorings.
Merge pull request #1 from bmuschko/refactoring

Some cleanups/added more tests.