test: extract createSharedClass to helper file

Move the function `createSharedClass()`
  from test/rest.test.js
  to test/helpers/shared-objects-factory.js
so that it can be reused by multiple tests.
ext/swagger supports non-root location of REST API

When the swagger extension is configured with a custom basePath,
this basePath is honored in the Swagger descriptors now.

1. When `options.basePath` is not defined, `http://{host}/`
  is filled based on the `Host:` header in the HTTP request.

2. When `options.basePath` starts with `/`, it is appended to the
  host URL, i.e. `http://{host}/{options.basePath}`.

3. When `option.basePath` is a http or https URL, then this value
  is passed to the descriptor without any modifications.
Merge pull request #25 from strongloop/feature/swagger-support-for-custom-api-path

Swagger supports non-root location of REST API