Added texture support. Modified templates.