This is where it would be nice to have some kind of 'superclass' concept in js, instead of checking for 4 different classes :)

Perhaps we could do a .internalRepresentationOfSomethingInSQL property in our 'special objects', instead of checking for instanceof?