Create compat.js

compatibility shims for older environments