Move semantic analysis into new file.
Move ast operations into new file.