ACL support

Fixes #18

Further improvements on code formatting and function visibility