Arch refactor

Initial infrastructure for transaction and modal management.