Test coverage and extra functionality

Nearly ready for prime time!