Jasmine tests for verification / payment; small bugfixes

* Add Jasmine tests for a good chunk of the payment/verification JavaScript.
* Found and fixed a bug: the payment button should be enabled if there are no suggested prices (and no radio buttons).
* Some general cleanup / refactoring.

Reviewers: @rlucioni @AlasdairSwan 
Because the previous for loop uses 'i' it would be safer to use a different var here (e.g. 'j') just incase there is any JS asynchronous weirdness with crossover of loops.