Updating JUnit to v4 + permissions unit test
Fixing up permission logic.

* Changed handling of adding new permission paths.
* Changed permission logic to make more sense

NOTE: Permissions have a unit test now. If you change stuff in it,
make sure the test will still pass.