Added value formating, moved some code around, implemented rAF shim