First (rought) draft of an API to support dynamic code generation.

BKrev: 3ddee40eGymjbeNAPfICExNXHdkJcQ