Revert "Remove virtual destructor from AbstractFunction thus removing the need to store a virtual function table pointer"

This reverts commit 0be84830ad6942f2f1d15eb8c3e60900fb4b1504.