Make Material Add Form Collapsible and Added Format Validation to Material Links

Also removed unnecessary variable and checking of that variable along
with some other code cleanup.