add cmdline argument parser
add some comments
add memory allocate error check
add version define
re-write configure file parser