Classy JavaScript - Best Practices