changed $base_url to ENV['base_url']
Updated $base_url again and cleaned up some code in the kuality initialize method.