Add fromJs method to Resource and Collection.