Changes after the IAM notes 9/24

- Better logging
- Database naming conventions
- Code cleanup and rearrangement