add nopt
add cmd
fix json parse
make lib more extendable, change input format, update example
refine lib
update example and usage