Javascript animation framework