Function closure bugfixes
Shell functions, extra server stuff, WIP