From http://stackoverflow.com/questions/3061/calling-a-function-from-a-string-with-the-functions-name-in-python