admin: Refactor actions to accept functions

Add to the action class an ```f``` field, which can be used to store the
associated function with this action.