macro if guard for Memoization of labValue calculations

Pass in compiler macro definition 'MEMOIZE'  to make use of memoization
only when required since in some cases it is slower than the unmemoized
version.