Reduced overhead of calling memoryUsage() on SimpleTypedData.

The new implementation is approximately 2x faster than the previous one.
Merge pull request #343 from johnhaddon/memoryUsageOptimisation

Reduced overhead of calling memoryUsage() on SimpleTypedData.