Automatic function serialization

I'll just leave this here for you sir.