Resource handling improvements, and start adding material support