I'm just getting started as well. It seems like there's a little extra code in the
var ambient = require('ambient-attx4').use(tessel.port['A']);
does the same thing as the next two lines:
var ambientlib = require('../');// Replace '../' with 'ambient-attx4' in your own code
var ambient = ambientlib.use(tessel.port['A']);
When I removed those two lines it worked just fine. Hope that helps.