moved db sync to own file
switched tp promise style to get rid of event emitter warning in sync.js