Added basic audit logging functionality. Still needs testing (WIP)
Merged in audit logging