FLOE-194: Simplified the dialog re-rendering process and add some unit tests.