updates code style and js docs prior to applying update
replaces instanceof check with typeof to ensure it works for cross-window objects
Merge pull request #514 from bit-shifter/develop

code style improvements, updates mergeMaps with type check instead of instanceof