Refactored code to fully work on Mac. Also ignores deprecated declaration warnings

Signed-off-by: Arné Schreuder <arne@consulta.co.za>