Sprite sorting added. Matrix optimisations.