Refactor test setup for XBlock rendering and handlers.