Javascript modules, little bits of generic code