Fix function autoloading

Closes #3.