Simplified the mapping of data

Change-Id: I5597f243d238530b7fec535289cec6ee8bbd89fe
Remove code that is now redundant

Refactoring the data mapping code lead to the code block being used
when log scaling is in effect being identical to when log scaling is
not in effect. Collapsed this to one code block.

Change-Id: I25e6c56bcef7c580dbe0d318eff706613c562100
Moved conditional out of loops

Shortens code and might improve performance.

Change-Id: I77f02b6d3b498d675c9fef402389e0928db4a0e9
Remove now-unused functions

Change-Id: I9b797c6725da6497935c5300b834a683d32e874f
Put internal functions inside anonymous namespace

Change-Id: I1efeabec79427631057d5a79e282cd636292b2d5