Fixed output for polynomials and run some tests

The parser sucks, rewrite it