basic design pattern for jQuery widget