Add SDL event mapper and minor refactorings