Split program into several classes and command-line interface