Turning bitmap and valmap to methods.
Changed semantics of bitmap/valmap and simplified bit operations.