Added permission functions tests
Updated test scripts
Updated cookie functions tests
Tidied permissions functions
Moved comments
Updated permission tests
Added lookupPermissions tests
Moved addPermission out of exports
Don't export permissions, rename to _permissions
Use rewire
Refactor createSplitPermissions to no longer prematurely optimise
Fixed typo
Document generateSimplePermissions function
Use rewire to access _permissions
Reverted foolishly introduced syntax errors
Actually, use lowerCase, as the code expects.
Rename private splitPermissionUris function
Update permission tests
Moved splitPermissions to top, refactor to use permissions argument instead of global
Added getPermissions helper