Cleanup parser and remove long-dead code