1. refactored the code a bit.
2. added texture tag parsing.
Merge remote-tracking branch 'origin/master'