CIMI Models: rename hash in DSL to hash_map

Since 'hash' is used for putting objects into Hash, overriding it as a
class method causes surprises when a class is used as a hash key.
CIMI (schema): properly generate and track embedded collection classes
DB Entity: make sure we instantiate the correct subclass

We only ever instantiated Database::Entity, but never any of its
subclasses. We now keep a map of CIMI::Model => Database::Entity subclass
and call new on the appropriate subclass of Entity.
CIMI: split models into model and service objects

The current CIMI::Model classes address two concerns:

  * serialization/deserialization of CIMI objects
  * interaction with the current driver and the DB

This patch splits these two concerns into two separate class hierarchies:
CIMI::Model for (de)serialization and CIMI::Service for interacting with
drivers/db

Besides cleaning up the code, this will make it possible to reuse
CIMI::Model classes as the basis for client code.
CIMI: Apply $filter and $select in Base#list

No need to have ugly chained methods in collections.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/c2417e1f3383ae4a76e1d40d04440daed149bf95
CIMI: Migrated MachineImage to services

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/ac7d8b3fe7354da3cb2d29400632bfe36694556d
CIMI: Added Service::Base#parse method

Make possible to call .parse on Service models from
Rabbit collections.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/a16895d3bb6ab3596fb77fee96d041e01c3a1747
CIMI: Migrated service methods from CIMI::Model to CIMI::Service
CIMI: Use CIMI::Service namespace in Rabbit collections

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/4f61366999285c2dfbc497bdc0581c8b657d9191
CIMI: make ResourceMetadata work with the Model/Service split

Extension attributes now need to be mentioned twice: in the model class
they are declared like any other attribute. In the service class, resource
metadata can be added using

  metadata attr_name, :type => TYPE, :constraints => PROC
* server/lib/cimi/service/machine_template.rb (delete!): fix 500 error

The method was simply busted. Now also allows deletion of nonexisting
templates
CIMI::Model::Schema::Ref: do not support looking up the referenced object

This now depends on service objects and can therefore not be used from models
CIMI: a very simple test of volume creation
CIMI: remove unused model methods

Collection.all and Resource.all_uri do not make sense any more since they
ultimately depend on find, which is now a service method.