Reduce code
Add resolveElement utility
Conform to JS camelCase convention
Use Array.isArray built-in
Use classList.add not classList.push