Component Pattern for JavaScript