Rewrite dropdown JS to use module pattern

Rewrite dropdown JS to use module pattern and changed prefix into
genwpacc. Props to @GaryJones.