Options for simplifying custom node runtime code?

Yes, well my initial attempt has ended badly. When you call RED.nodes.registerType, the 2nd argument is a function. I coudn't find a way to have that function in a class instance, each time I get an error.

When I get some time, I'll create a separate thread on the subject.