Substantial additions and bug fixes

Moderate testing done, but not battle ready yet.