Extract the state machine of WITH-PACKAGE-ITERATOR into a function.

Also, by avoiding POSITION-IF and FIND-SYMBOL, not to mention the
useless (THE HASH-VECTOR) everywhere, it's significantly faster.
Add WITH-TEST, improve test for DOCUMENTATION on (SETF ...)
Test DOCUMENTATION for DOC-TYPEs PACKAGE, VARIABLE