OMS API refactoring

Moved models/sql logic into their own library (located in Base)