Allow floating monsters to become unstuck

Despite previous attempts, Cacodemons (at least) were still becoming
stuck together if one happened to come up underneath the other (the
dirty bastards!) This fix checks if things are stuck together and allows
the move to happen if it makes them further apart. A small amount of
refactoring too.