```coffeescript
_  = require 'underscore'
traverse = require 'traverse'

KONFIG = {}

try
  module.exports = KONFIG = JSON.parse process.env.KONFIG_JSON
catch err
  console.error 'error: could not parse KONFIG_JSON environment variable'
  console.error err
  process.exit 1

traverse.forEach KONFIG, (node) ->
  if val = process.env["KONFIG_#{this.path.join('_').toUpperCase()}"]
    try val = JSON.parse val
  return val or node

KONFIG.getConfigScriptTag = (mixin = {}) ->
  config = _.extend {}, @client.runtimeOptions, mixin
  """
  <script>var KD = #{JSON.stringify {config}};</script>
  """
```

Add Array::first and Array::last back
user
```coffeescript
_  = require 'underscore'
traverse = require 'traverse'

KONFIG = {}

do ->
  unless 'first' of Array.prototype
    Object.defineProperty Array.prototype, 'first',
      get: -> this[0]
  unless 'last' of Array.prototype
    Object.defineProperty Array.prototype, 'last',
      get: -> this[this.length-1]


try
  module.exports = KONFIG = JSON.parse process.env.KONFIG_JSON
catch err
  console.error 'error: could not parse KONFIG_JSON environment variable'
  console.error err
  process.exit 1

traverse.forEach KONFIG, (node) ->
  if val = process.env["KONFIG_#{this.path.join('_').toUpperCase()}"]
    try val = JSON.parse val
  return val or node

KONFIG.getConfigScriptTag = (mixin = {}) ->
  config = _.extend {}, @client.runtimeOptions, mixin
  """
  <script>var KD = #{JSON.stringify {config}};</script>
  """
```
assistant