Further refactor boundaries.js. Still work in progress.