[PATCH] refactor capable() to one implementation, add __capable() helper