Insert commands only rebuild when setting changes

Previously insert mode would rebuild its commands whenever any setting
in the system was updated (changed or not).  This was taking up ~20% of
the time during suite runs.  The code was switched to only rebuild when
the pertinent setting was changed
Fixed a memory leak issue