Re-factored base resource API out of keystone

To allow other clients to more easily use the REST API helpers, they
have been re-factored out of keystone package.

Change-Id: I5fde703293ff8f2668789053a36e293dc6fc6c53