added solution to Q1 and began transforming application to requirejs modules