Refactor option parsing to separate class, add log4r
Use Log4r for logging and replace puts

The level of output can be specified with the --level parameter. Also
change 20 second warning to 10 second.