Updated javascript syntax and organisation

Starting to implement tips and tricks from Angular Mentor.