I'm glad you working with the clock. I hope it's working well and you have "tight" time (I have 1ms).
By the way I discovered cause of Reaper's midi clock fails. I have connected midi out of Reaper to Midi in and log it with midi logger: one SPP is missing comparing to JS beat_position (one sixteenth note). Should be SPP=4*beat_position and reaper does 4*beat_position +1 or -1 I can't rememeber now. Should work fine after correction.