Implemented visitors and re-organized ast classes