issue #23878 - merge bankrec functions

The functions have been merged and a test added. There are a number of commented-out TODO lines in the test which would fail if uncommented. They might represent misunderstandings of the desired gltrans and tax history behavior. @garyhgohoos should review the test before this PR is merged to figure out whether the test or the function should be changed.
Hmm... build a long query string with `[].join()`? I see merit in the idea - I prefer whitespace to the array fluff but `.join(' ')` is safer than `+` string concatenation. jshint finds most but not all of the problems with `+` code. ECMAScript5's backslash string continuation would be closer to what we're already doing on the C++ side but I haven't tried it yet.