moving grid JS into a stand-alone jQuery plugin