Initial refactor.
Merge branch 'MOBILE-427' of https://github.com/tonyblundell/moodlemobile into MOBILE-427

Conflicts:
	lib/mm.js