Move fromJson, fromXml to resource factory. update readme with some potential api changes