refactor things into a real jquery module