Use `setImmediate` if available

Node.js 0.12 deprecate `process.nextTick`, so we use setImmediate when
available, fallback to process.nextTick otherwise.
Join `sourceRoot` and `destinationRoot` logic together

Logic for these method was split in base.js and actions.js. Now they're
merged back together.