First implement of framework (unready)
massive refactoring
tidied constants, tidied dataflow
fixed button visibility
refactoring and new features