Separating code out into modules, added ionic lib