Goog idea to split this into multiple functions! However, I'd like to see less duplication here.

What do you think about turning lines 39 to 45 into something like `test.functionSpec(main.parseLayerName, spec)`?
For this, the whole logic of calling the function using the keys, and comparing the serialized results needs to be put in one function. See http://stackoverflow.com/questions/8533757/how-to-add-custom-assertions-in-nodeunit for how this could be accomplished.