Add some nifty badges
Refactor core to allow for easier testing
Add some basic tests
Fix a couple bugs caught by tests