better error msg for source map problems, removing unused funcs from parseAst, fixing IO monad write