Rebind all javascript components when a modal opens

Refactored the javascripts a bit to make all components have the same pattern:
an object with a method `bind()`. So now `mconf.Resources.bind()` binds all
elements we need to bind we a page is updated (e.g. when a modal is opened).

Also make sure all events (click, etc) are bound with using namespaces so we
can make sure they are bound only once even if the method they are in is
called several times.