Modularized code, and improved the serial connection code. Serial connection code is still incomplete.