Fixed some issues with the PermissionSet support.
Added some basic tests for the security sandbox.