Big refactor, fix missing order in MariaDB, new layout etc.