Added physics events

also:
- arranged headers
- cleaned some code