Include functions in gen.sh and beta alchemist_beta support

Split gen.sh into a functions, and give a few options during runtime, otherwise it should run just the same as it did before. Should allow it to be more flexible as more options are added in the future.

Has beta support for installing alchemist_beta which:

* Mirrors http://repo.steampowered.com/steamos/dists/alchemist_beta/ and updates /pool in buildroot
* Re-builds repos using apt-ftparchive-beta.conf
* Replaces install.amd/initrd.gz and install.amd/gtk/initrd.gz with modified files from beta/ that point to alchemist_beta

Beta support is completely un-tested currently. Put in https://github.com/ValveSoftware/SteamOS/issues/67 requesting rsync enabled on repo.steampowered.com to make local mirror syncs easier.