Finalize a source code to create a main database; tidy up old files and folders