Introduced MyBatis (not refactored to it completely yet).

Also improved `on ajax error` handling.
Introduced mybatis-migrations.
Improved chaining $http promises.
Gave up SQL (for ad-hoc will just dump to SQL when needed).