Changes made by Kelvin Kosbab (kelvin@kosbab.com). Commit updates before transferring to custom network protocol.