Reorg. Split into app and lib.