Added dynamic resolving of database for models.

- Also normalized some files to use proper method naming