Initial commit.

Both scripts pass most tests. Print's check function do not work if the same
material is distributed over multiple slots.