New Database Structure Part 1

Updated les_engine to work with the new database structure, part 1.