major restructure... get all code out of headers. first cut of cv