Cleaned up binding of foreign functions with new handy-dandy function