Next round of refactoring. Attempting to normalize the terminology used. Fixed some bugs that have been around for a while too.