Initial stab at rewriting flash utility (work in progress)