Fix 20

Fixes #20 

Adds tests for parts of the system. More tests needed for core functionality.