refine amf0 and handshake code, add comments to utest.