Unit test set-up + ton of changes

Too much to describe