Using !equals instead of != to compare location keys in locationMoved

Unfortunately Eclipse performed some fixes (trimmed trailing whitespace
and other such changes) which altered the rest of the code in ways that
do not change functionality in any way.
Reordered sections in documentation, fixed typo.

Typo was all-caps variable 'REF' that was to have been 'ref'