Update medfun to support Python 3