bug #651 - write tests for all functional, change imports

https://gist.github.com/rgatkowski/6796308