Split defineAction$ method.

The actual creating of the action is now its own method, aiding the hackability
of the framework by extensions that need to access every action created.