Added types to all protocol messages. Fixed up build system.