Finish logic functions(It's fvcking long...)
Some small patch on protocol definition:
    new fetchmsg struct
Merge branch 'prototype' of github.com:longruiliu/ECR into prototype