Rearranged lib structure and moved to a more robust Commander-based CLI.