AST: Small code cleanup

Move the pointer to be adjacent to the variable instead of the type.

No functional change.
Improve some gtest assertions

As requested during review, compare pointers to NULL explicitly to make what's
going on more clear.