Refactored texture loading to be a bit more extensible.