Move functions to autoload file, add fold markers

fixes #10