Working out basic event flow and command parsing