add template source in template functions if possible
quirks mode for classes

this change allows make simple usable bindings for classes