Cleaned up some Batch functions and added our first test.