Refactored architecture

Split services into separate layer
Split UI into separate layer
Refactored DB into an AngularJS service
Implemented native WebSQL and IndexedDB for performance