Generic JavaScript framework