Re-integrated old unit tests... still loads of code to refactor.