refactoring, adding some new features, tightening up the tests
clean whitespace
Merge pull request #6 from hawkowl/feature-core_refactor

Refactoring the core a bit