Reimplement the FlashHandler and related classes. Update test case.