Allow controller mapping to be done outside of the main program. Related to issue #122.