Software renderer in Javascript