Lightweight javascript framework encapsulating common operations