Rework function handling. Remove the old function classes and use one instead.
Also, make Core functions native functions for increased performance.