Completely rewrite the Sprite class and fix a load of issues with threading