Added database test.
Further decomposed models.