Throw an exception if a map div is not found

and test for initialization exceptions
Merge pull request #1574 from tmcw/map-initialization-exception

Throw an exception if a map div is not found and test for initialization exceptions