Why do you need a string registration system? Why can't you replace all occurrences of 'Dygraph.DataHandlers.createHandler("bars")' with Dygraph.DataHandlers.Bars? It's generally better to use symbols that the compiler/interpreter understands than opaque strings that it doesn't. You'll catch errors more quickly that way.