JS: new `isValidNumber()` to check for valid input

* Move emptying the adjacent input when if-statement up
* Update sums on page load for browsers that keep input values on soft page refresh (FF)