split out browser specific util to separate file, update tests and demos and build file accordingly