Updated JS, fixed bug in env switching. Updated Travis config