Also added unit tests. Should have done separately but found a number of bugs.
This allows users to tag a branch as readonly or not for writing regardless of how the filesystem is mounted. Should simplify deployments and offer more flexibility.