More robust PrepareComponent, with tests
Simplify file writing
Skip graphs for now