Added templates directory for angular routing. Reformatted functions js file to be modular