Merge "More general texture handling. Some cleanup." into graphics-dev