Make Schema::getDimension and friends faster by returning pointers

I'm continuing work on #153 here because I can't open a proper pull request