make registeranim() run in a limited sandbox

registeranim() now runs in a limited sandbox environment where it is
only possible to register animations- nothing else is possible. This
commit also cleans up the actual setting and stopping of animations a
bit