Added WAV support, config file based setup and improved code readability/structure