restapi: Refactor VM and Template mappers

Refactor VmMapper and TemplateMapper classe and extract common set of
field mappings to newly created VmBaseMapper class.

Also introduce new base resource class VmBase from which the VM and
Template are derived similarly as they are implemented on the backend.

Change-Id: Iddd80e10360234d75d142f224ecb8ad920fbf282
Signed-off-by: Martin Betak <mbetak@redhat.com>