[Refactor|Semantic analyse] Better semantic analyse and recreate a clean AST after the analysis. It closes #16 and #21.