Fix issue 4673 - Bug in std.string (isNumeric)

Refactoring some code as well. I think this is an awful function anyway - is it useful to anyone?