Add a new way to test optimization

* Check is the output is the one expected
Code factorisation for Pythran frontend