Cleaned up directory, and further refactoring.

Preparation for batch testing underway.