Finish the main frame

Finished the state transition with essential functions like transmit(),
recv(), and respond(). Also a global logger Log is provided for
debugging purpose.