Redmine 3572: reworked reading of non-fncall values

Made failure to read string as int or real, when specified as such, a
PROMISE_RESULT_FAIL, instead of setting to a bogus value.  Reworked
the block that handles this so as to avoid repetition of code.  This
fixes parsing of simple values from unexpanded variables; a later
convergence pass shall see the variables expanded and succeed.
Includes acceptance tests for general parsing of numbers, the basic
problem and regextract usage.
Moved a test outside a loop to save a waste of time.

In BundleResolve(), looping over promise-types doesn't change the
bundle type; and we did nothing inside the loop unless the bundle type
is "common", so may as well test that before entering the loop,
instead of each time round the loop.  Tidied up a bit, too: split some
long lines, killed a boring blank line.
Compile-fix: use correct formatter for size_t parameter.
Merge pull request #1394 from ediosyncratic/vars-3572-fix

Fix for part of Redmine 3572, plus some tidy-up.