fixes #1: completely refractored;
no longer depend on nopt but minimist
adjust test cases and ci conf