Jquery widget factory and tools