Some small changes to make it easier to 'subclass' and specialize Resource

I want to have a variant of `Resource` that accepts middleware (`authenticate` & `persistence` keys) and validates incoming JSON according to a schema (`schema` key), in order to emulate some of the features of [Percolator](percolatorjs.com). This was approximately the minimum way I could see how to do that.