Tidy up model building from data sources

See https://github.com/strongloop/loopback/issues/560
Merge tag 'v2.9.0'

2.9.0
Test improvement, shows _targetClass camelCase bug

There is an issue where setting _targetClass on hasAndBelongsToMany
relations with a camel-case model name, fails.

Signed-off-by: Khashayar Hajian <me@khashayar.me>
Fix camel-case issue where relation is 'hasAndBelongsToMany' #304

Signed-off-by: Khashayar Hajian <me@khashayar.me>
Merge pull request #303 from khashayar/feature/test-improvement

Test improvement, shows _targetClass camelCase bug
Merge pull request #301 from strongloop/feature/allow-base-for-discovery

Tidy up model building from data sources
Add contribution guidelines

Uses https://cla.strongloop.com
Extract mergeQuery and setScopeValuesFromWhere

Related to #274 - in preparation of default scope
Implemented collection setting for Memory connector
Properly reset Memory connector cache on automigrate
Full test CRUD suite for default scope
Allow default scope to be a function
Test default scope with relations
applyProperties => properties (object/false)
Cleanup, consistency: allow properties to be a function

Also, pass along the current instance, for any instance method as a
context (save, updateAttributes).
Allow `attributes` as an alias for `properties` (for LDL)
Fix failing test
Merge pull request #296 from fabien/feature/default-scope

Default scope
Implement include scopes
Refactored inclusion

The syntax is now consistent, regardless of using [] or {} for the
include param.