Work in progress.

Major re-work of identifier resolution.  Now checks for duplicate
declarations on encountering a declaration.  However, some nodes are
still being processed twice.