Review order of conditions to optimize performance

If we do not need authorization, there is no need to perform a lookup (with an order_by) which could have a cost not negligible.
Merge pull request #499 from mtparet/patch-1

Review order of conditions to optimize performance
Support sandboxed/private client applications

Set a public flag on Doorkeeper::Application which, when present and false will prevent anyone but the application owner from authorizing with it.
Initial pass at client application specific scopes
Add Models::Mongoid::Scopes to Mongoid version of Application model
Application scopes should be always-on