Standardize code styles and some refactoring
Fixes #2 - incorrect attendance stats for new semesters