Updated/Undo most changes

I changed things that didn't need to be changed. This has now been tested and works as expected with one possible exception.

I found that I could not use the printOnLoad() function within my controller but had to call it from the view after passing the map object to the view. If tried to pass the data from the controller as your examples show, I get an error that the onLoadmap function is not defined in the Javascript.