Cleaning up models; adding more unit tests