Classes and command line options

Restruected the program to use classes. Added support for invoking the
program through the comand line.