Refactored uglier bits. Interface changes. Simplified some tests.
Merge pull request #6 from jonnystorm/refactoring

Refactored uglier bits. Interface changes. Simplified some tests.