Main.hs: Removed writing errors to stdout, removed dead code, documented code.