Re-added some function to cleaned version

Added back database, mail, and model to system folder.