Move the instantiation of javascript ui elements to a separate module