Port v2 image_metadata extension to work in v2.1(v3) framework

Port v2 image_metadata extension and adapts it to the v2.1/v3 API
framework. API behaviour is identical with the exception that
there is no support for XML. Also

- unittest code modified to share existing testing with both
  v2/v2.1
- Adds expected error decorators for API methods
- Adds API samples

Partially implements blueprint v2-on-v3-api

Change-Id: Ibc8dc897f3449a1c70bc7ac1510445f48fddb291
Merge "Port v2 image_metadata extension to work in v2.1(v3) framework"