Backport function overloading from trunk
Move fromJson conversion to AbstractType classes