ACL implemented with unit tests
Fixes numerous bugs and some typos, adds tests.