Making coverage more realistic

Also starting to restructure code to try to make it easier to test and
separate