Adding database functions
Drop reference tables on create
Cleaning up DB procedures