Replace on/off vars with compile time constants
Move modes into separate file.