Implemented widget rendering and page swapping.