separate functions and use cached element

Separated out native vs simulated HTML5 dataset usage and fixed up the test to see if native was available