Some preparations and helper functions added, e.g. option --enable-cli