Improve has_permission performance and return sorted lists for User/Character permissions.

The User and Character has_permission methods were changed to return a
sorted list of the permissions rather than a set, change the user user
has_permission method to use the Permission.set_has_permission method,
and modify the Permission.set_has_permission to use a binary search
algorithm for better performance.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Remove the wildcard evaluation when returning a character's permissions.

The EVECharacter.permissions method no longer returns the permissions
granted by a wildcard permission held by the character unless the
character has that permission explicitly granted. The wildcard
expansion was removed due to significant performance degradation that
it caused; this change alone reduced to the load time for /group/manage
by over 67%.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Fix some bugs in the permission evaluation code.

Fix a couple name errors as well as an issue with the algorithm used
to determine if a set has a given permission.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Add support for wildcard permissions to the new permission checking algorithm.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Remove the binary seach from set_grants_permission.

The binary search algorithm didn't properly support wildcard
permissions with a wildcard in the middle, and the performance
improvement provided by the new algorithm was so negligible at tested
values that it wasn't worth resolving that issue. I'm leaving the
commits in the PR however, so that if we ever need to go back and fix
it due to permission issues we'll have it in the history.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Fix a bug in User.has_permission()

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>
Merge pull request #334 from Acidity/feature/groupsPerformance

Improve performance of permissions related methods and functions.