Cleanup and comment decompose_schema
Fix up tests