Preliminary capture code works.
Various cleanup including import organization.