targets/core: Set proxy variables based on previous proxy setting

On update, obtain *_proxy variables from the previously generated
environment, and export them after sanitizing the value (to make
sure we do not eval random harmful stuff).

Fixes #883.
installer/ubuntu/prepare: detect_mirror function

Detects the current mirror.
targets/xorg: >=saucy, kernel 3.4, pin down precise mesa drivers.

On saucy onwards, if kernel version is 3.4, manually pin down old
mesa libraries from precise (mesa 8), as new ones (mesa >=9)
require kernel >=3.6.

Fixes #704.
targets/xorg: Only downgrade on non-Atom Intel chipsets
Fix check for default variable values.
targets/xorg: Remove unnecessary apt-upgrade
targets/core: Just source the new environment file from the installer

Simpler, should be safe enough.
Merge pull request #913 from drinkcat/pin-3.4-drivers

>= saucy on kernel 3.4 and non-Atom Intel, downgrade mesa to version 8 (precise)
Unit testing: add tool to import functions from scripts
Shuffle release order for each test.
xdg-utils is necessary for proper functioning of the croutonpowerd daemon
Merge pull request #911 from drinkcat/fix-proxy-env

targets/core: Set proxy variables based on previous proxy setting
Merge pull request #916 from dnschneid/randomrelorder

Shuffle release order for each test.
Merge pull request #915 from dnschneid/unittesting

Unit testing: add tool to import functions from scripts
targets/xorg: Downgrade some extra packages

mesa also provides some other packages (e.g. -dev and -dbg packages),
make sure we also downgrade the ones that break when we try to
install them.

See http://packages.ubuntu.com/source/precise/mesa for a full list,
a number of them probably work fine with more recent GL libraries
and may not need downgrading (e.g. libgbm), so we do not downgrade
them.
Merge pull request #922 from drinkcat/mesa-add-missing-pin

targets/xorg: Downgrade some extra packages
targets/xorg: lts-saucy will disappear soon, use lts-trusty
Merge pull request #925 from drinkcat/xorg-precise-lts-trusty

targets/xorg: lts-saucy will disappear soon, use lts-trusty
store chroots in /home/chronos for free encryption