added export option

it is now possible to export the material entirely and correctly to
javascript code.