Added documentation to, cleaned up stage.js.