Flux architecture (with Reflux)

Lots of refactoring into the Reflux architecture, which makes the data flow much cleaner and gets rid of a lot of bad old code.