lib/rts.js: add legacy code to code browsers without support for ArrayBuffer