Pr/325

Tests are WIP. Not yet ready to merge.

Closes #325