Add frontend.

Also swap meaning of if0 so it's hopefully correct.