Adding lazy load to the relations.
Adding database support for the function tests.