Initial code in place

It works, mostly. Some message types still need tweaking, and button mashing can occasionally produce a NullPointerException, but it works. 

EXPECT RADICAL CHANGES IN THE FUTURE. The current state of the code is very likely to not resemble future iterations.