Refactored general app code to angular module (closes #22)