Javascript timeline-based animation engine