Map javascript refactoring done, and extent zooming fixed in collections.

http://jira.catami.org:8080/browse/CAT-465
http://jira.catami.org:8080/browse/CAT-383