allow serialization other things than case classes

the default `toJson' implementation handles now more cases, such as
numeric types, booleans and strings