Sorted out imports
Added some tests as well as moved around things to make more sense.