I've been playing with jquery for a week or two now and have something that resembles a hackey overgrown example. It needs structure - I've worked with MVC before in java etc.. but im finding it hard to translate my large .js file into a number of distinct and logically separated views. 

Within these views I'd like to be able create instances of certain widgets (its basically a div with a few buttons and some draggable behaviour). Obviously I'd like to be able to take advantage of inheritance as certain overgrown divs share the same sort of characteristics. 

I know how to do this in Java but I cant seem to get my head within javascript. I can get to a point I can isolate a function call which in theory would hit something resembling a controller. At this point I proceed to check certain styles of a parent div etc. and then do a lot of appendTo's to a particular div thus creating my component. 

In short how might I create a little widget and reference it within my jquery topped javascript. I'm not to sure about defining the object and creating event handlers etc for it. I guess I've been a hacker of js too long !

If you want an idea at what my current code resembles please see <http://jqueryui.com/demos/droppable/#photo-manager> I've basically added a number of other droppables and have to determine what div im dragging to and then do various things. Again its all kinda hackey. I'd like to make it a bit more engineered.

I've started to look at something like Backbone.js but I'd like advise on how to properly create my widgets.

Many thanks SO