Start migrating functions to new script format

Got it working again :dancer: