More unit tests for actions. Fixed a few issues identified by the tests. All writing based tests currently fail - appears to be a priviledges issue.