Refactor and Add test for Attendance model
[Closes #39]