Adapt code to the ActionManager refactoring, and to the new coding guidelines. Also add some tests.
id