Integration fixes from bewest

@bewest: I cherry-picked your commits from #5 and fixed a conflict in `config.js`. If that's all right, we can merge this one and close #5?

Thanks