Autoexplore: Don't end on a random corridor corner

Autoexplore often finishes a level by taking the player halfway across
it to a corridor space that happens to be diagonally adjacent to an
unexplored space, which is annoying because there's never anything
interesting there.  This change eliminates this phenomenon.

Fixes #22 on GitHub.
Autoexplore: Don't stop for explored object piles

This moves the setting of mem_stepped from domove() to pre_move_tasks(),
allowing code that runs for the current player action to use mem_stepped
to check if the current space has been stepped on before.

pickup() and check_here() now use this info to prevent stopping on
object piles that have been explored before.  In case the object pile
changed since it was last visited, map_object() unsets mem_stepped to
flag it as worth autoexploring again.
Fix spurious dmonsfree impossible errors

This fixes the "dmonsfree: 0 removed doesn't match 1 pending" errors
that sometimes appear when saving or quitting.

purge_monsters is moved from iflags to levelflags, since dmonsfree()
operates on a level-by-level basis and thus tracking it any way other
than per-level makes no sense.
Improve matching/filtering in multi-drop/loot menu

This adds the menumatch option (default tight), telling multi-drop/loot
menus in full menustyle to match e.g. 'cursed' and 'armor' to 'cursed
armor' rather than 'cursed objects' and 'armor'; the latter old behavior
can be restored by setting menumatch to loose instead.

Choosing "A - Auto-select every item" with match criteria selected now
respects that criteria.  This isn't affected by menumatch, though
choosing it on its own still auto-selects everything.

Closes #46 on GitHub.
Remove swap + twoweapon from object action menus

These commands clutter object action menus and only apply to a subset of
characters.

This reverts most of 851b23c1ae (add swap + twoweapon to wielded obj
action menus), but keeps the ability to set no-argument next commands.
Don't imply Sokoban was reached in conducts

This is meant to go with ed5d6b1542 (CS1050 remove Sokoban luck penalty,
earth scrolls).
Prevent buffer overflow when changing boolean opts

Fixes #51 on GitHub.
Show description when changing enum options

Closes #50 on GitHub.
Show current setting when changing enum options

Similar to what's done for boolean options.
Respect G_NOGEN when making mon by class on splevs

This prevents e.g. chromatic dragons being randomly created when special
levels (like castle-3) request a random 'D' monster.

This bug also exists in UnNetHack.

This bug also exists in vanilla NetHack.

Fixes #48 on GitHub.
Add more alternate object spellings when wishing

 * lembas
 * wand of invisibility/speed/teleport
 * ring of strength/constitution/intelligence/wisdom/dexterity
 * ring of accuracy/damage

Also, makesingular() no longer mangles "lembas" into "lemba".

There are plenty of other possible alternate spellings for other
objects, particularly other wands, but the point of these additions is
to relieve the player of remembering useless details like the "gain" in
"ring of gain strength", not to cover every single name interpretation.

Closes #38 on GitHub.
Enhance object name detection heuristic

That is, the code that detects if the name given to an object is an
actual name so it can be looked up in data.base when examining them, as
opposed to player note-taking.

To be considered as such, a name now must start with a capital letter,
and also consist of only letters, spaces, "hyphens" (the '-' character)
and single quotes.

Closes #43 on GitHub.
Show inventory weight and used slot count

Both the inventory menu and the sidebar inventory listing now show
"150/900wt (12 of 52 slots)" in the title line, which updates whenever
the player's inventory changes.  The numbers are current weight, maximum
weight before burdened and the number of stacks of objects in the
inventory.

Internally, this info in the sidebar needs updates to player status that
are made for the status lines to occur before drawing the sidebar (read:
curses_update_status() needs to be called before draw_sidebar() /
curses_list_items()), otherwise the info may lag a bit.

Closes #32 on GitHub.
Fix object matching when category menu is skipped

Without this fix, multi-drop will incorrectly say "no matching objects"
with only one object in the inventory when menumatch is set to tight,
and looting a bag with a single object inside says the same thing.

This is meant to go with commit 335ba62d9d (improve matching/filtering
in multi-drop/loot menu).
Autoexplore: Fix repeated exploring of ball+chain

Without this fix, autoexplore wouldn't work at all when punished, since
the game would lead the the player back over their attached ball and/or
chain whenever they moved.

This is meant to go with commit 2f85168184 (autoexplore: don't stop for
explored object piles).
Fix armor conduct count when restoring a game

This fixes a bug with the worn-armor conduct count being incremented
redundantly when restoring a game, noted to exist in the extended
conducts patch.  Nothing was done about it there, since that count
wasn't shown unless in wizard mode, until UnNetHack made this info
visible at the end of games.

This is meant to go with commit d9755fc6a1 (CS405 extended conducts
patch) and commit 5f60bc4ffc (CS995 dump same game info at game end as
wizard mode).

This bug also exists in UnNetHack.
Fix log deviation when restoring on certain turns

Without this, restoring a game on a turn divisible by 15 advances RNG
state without taking a turn, due to a check for automatic clairvoyance
(also may change level memory in zero turns, noted on the NetHack wiki,
so this bug also exists in vanilla NetHack).

Similarly, restoring a game on a turn divisible by 100 may change game
state due to real-time effects in zero turns, e.g. full moon or Friday
the 13th, potentially causing log replay deviation of its own.  For
time-related messages to still be shown when restoring a game, they had
to be split out into their own function.

This bug also exists in upstream NitroHack.

Fixes #45 on GitHub.
Color frame borders when hit points are low

If frames are visible, HP under 25% draws them red, under 50% orange and
under 75% yellow.  This can be toggled with the new frame_hp_color UI
option.

This was surprisingly difficult to implement, given:

 * Under normal circumstances, the frame is not refreshed often enough
   to act as a real-time HP warning system, so frame redraws must occur
   at the same time HP is updated.

 * The UI is divided into virtual "windows" and frames are drawn on the
   very bottom one, so updating it means redrawing everything, which is
   slow.  Ignoring this causes the message area to sometimes vanish.
   ncurses comes with a panels library which is designed to solve
   exactly this problem, but NitroHack doesn't use it for some reason.

 * ncurses windows go through several layers of buffering for
   efficiency, so calling wnoutrefresh() is futile for windows with
   unchanged contents unless you call touchwin() first.

 * Status/HP updates occur frequently, so a custom fast frame updating
   function had to be written, read: redraw_frame() is just
   redraw_game_windows() with frames assumed and touchwin() replacing
   redrawwin().  Without this, updates slow the game down and the cursor
   jumps around like crazy.

 * Parts of the frame are drawn elsewhere in the code, like replay info
   and the sidebar inventory/floor divider, so they need both the right
   color and to be updated in tandem with the rest of the frame.

Closes #37 on GitHub.
Show number of turns used after multi-move actions

For example, putting on crystal plate mail gives, "You finish your
dressing maneuver.  [6 turns]" and engraving Elbereth with a hard gem
gives "You finish engraving.  [8 turns]"  The turn threshold can be
controlled with the new delay_msg option; setting it to zero disables
it.  NitroHack doesn't wrap long messages, and starts a new line for
every message on a different turn, so this will probably look nicer with
NetHack4's message line word wrapping.

The hardest part of making this work was discovering that do_delay_msg()
had to go after pre_move_tasks(), since the latter can set multi to
zero and the former needs that info to work properly.

Closes #41 on GitHub.
Add quick command reference

This serves the same purpose as NetHack's list of game commands, acts as
an alternative to NitroHack's full list of game commands and is (in my
opinion at least) more readable than both:

 * Commands are grouped by purpose instead of key or internal name.
 * Only commands that are commonly used or unique in function are listed.
 * Descriptions favor clarity over precision.

It can be quickly accessed via ?? and is thus implemented in the
front-end.