Refactoring animation logic for cross browser

Have broken the functionality for the time being, but thats cool