ENH: Work towards python 2/3 compatibility.

Adds a test for the schedule_function api method.