Reorganize into core, database and user_interface packages