compile time flag to switch between virtual and non-virtual functions.

Rather surprisingly, the virtual functions produce a smaller library than the non-virtual ones, which I'm finding hard to explain.