Refactor pickup and end as events (#225)

Refactor handling of game events into own source