#37 Fixed resolving of constant identifiers

Resolving identifiers in binary expressions was broken, especially for
bit masks.

A side-effect of the fix is that any lang::constant reference will now
always assume the type of its enumeration.

Fixed #37