ctp: port instrument.py from lovelylain

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: update ctpagent.py and ctpapi.py

*) import instrument.
*) add add_mdapi() in __init__ for ctpapi.py.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>