migrated funds job from ancient metridoc

this is the initial port from our ancient version of metridoc.  Seems
 to work well, need more testing.