Switching to protocol buffers and other improvements