Fix in-memory persistence layer collection handling

The in-memory persistence layer was implemented with some incoherence, and
handled indexing to locate a specific document incorrectly.  It tried to treat
an array of all instances as a hash, rather than finding the record directly
in memory.

As a side effect I was able to delete a few extra lines of code by eliminating
one stateful variable, and using a Ruby feature to fill in blank values in the
target hash appropriately.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Add basic test for `razor policy add`

This adds a basic unit test for the policy slice, around adding a new record;
it attempts to validate the end to end success case, inspired by the failure
noted in #431 - our existing tests didn't discover the failure mode for
configuration access in an inappropriate location.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Fix the server configuration spec for the in-memory persistence update

The configuration object in Razor is stateful.  This means that change
propagates between our tests freely, if they run in the same Ruby VM, and we
end up with the "use in-memory persistence" configuration in the global
helpers causing failures in the config specs.

To combat this the global state is now reset in the configuration code tests,
to ensure that we continue to enter them in the state that we believe we
should be in.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>