Refactored AST types out of traits

There is no benefit of them being path-dependent types, so they are now
in the 'ast' package.