Remove some temporary debugging code
Add schema functions that work with IDs rather than types.

After all, the underlying layer/schema function does.