added requestanimationframe function that fits all browsers/ also added ...

...main function that loops depending on elapsed time since the last render