Update schema.js

Several improvements for schema