Turning bitmap and valmap to methods.
Changing the semantics of bitmap/valmap + cleaning up code generation.