Middleware for flags

fao @commuterjoy @wheresrhys 
the toggler isn't just for developers :smile: