Refactor BaseResource.extendAs to properly setup root

BaseResource.extendAs takes a constructor function.
No resource classes define instantiate, they use the above.
This ensures resource.root is always correct.