Move part of the playable character logic to scripting

Adds support for "if", "while" and "for" in scripting
Adds named object events (writable string properties accessible as object.events.event_name)
Scriptable support for playable animation suffix, direction and jumping internals
Move playable animation end logic ans a couple more events to scripting