Fix user model detection + upgrade loopback to 2.x 

Fix the code detecting User model to support both `User` model itself and models extending `User`.

Close #59.

/to @ritch please review