Set up database script, sql migration system. Moved template to config directory.