Fix element/type nameclash

If a type has the same name as an element the element may be returned when we are in fact looking for the type.

This fix ensures that we only return simple or complex type nodes.

Also simplified identification boolean flow and clean up documentation a bit.
Merge pull request #85 from kasperg/fix-element-type-nameclash

Fix element/type nameclash