Build a boolean vector representing an integer value.
Builds a boolean vector that represents the value val using bitnum bits. The value will be represented with the LSB at the position 0 and the MSB at position bitnum - 1.
Returns:
The boolean vector (which is already reference counted).