Added tests for actions.

Includes some minor tweaks to the action module in order to support
good patching and testing.