Run tests using loopback 2.x.
Fix the code detecting User model

Fix the check to support both `User` model itself and models extending
`User`.