First-pass at module for preparing wafer data. Lots of hacks.