First stab at conditional compilation

Not for merging yet, just feedback. Currently only supports boolean operations.