Refactor js data attributes as variables

The following discussion from !74054 (merged) should be addressed:

  • @dstull started a discussion:

    thought (non-blocking):

    I wonder if some of this would be easier to test and consume if data were defined as a helper(and camel cased variables that existed before this MR were converted to snake case)...

    merely an opinion. Feel free to keep what you have.