Added configuration file support. Fixed numerous bugs.