cleaned up + extracted materials component code

updated all examples to include external code input in predefined
material component