Refactoring battle simulation code

- adding exception throwing
- breaking up long functions
- some slight renaming
- extending module testing