Added relations to models. Added some model unit tests.