Use http_vhost instead of guessing schema in redirects

I was still noticing an incorrect redirect to the login view. This was
caused by a wrong guess of the url scheme in the Redirect response,
which in turn was (probably) caused by the fact that uWSGI does not know
what to use for the HTTPS environment variable (since it runs as a
unix-socket).

This change moves away from guessing the schema based on the environment
variable, and uses the `http_vhost' option instead. On my server, this
resolves the issue and I am now correctly redirected to the https
version of the login page.

Fixes and refs #334.
Re-introduced output in CalledProcessError

In python 2.6, there was no 'output' attribute for the CalledProcessError
exception; there was no 'check_output()' there either. Because of this,
a wrapper was written in submin/common/execute.py, but this wrapper didn't
add the output if the code was run by python 2.6.

The output was removed in a previous commit (7271528), because it didn't work
in python 2.6. This change will reintroduce the output simply by attaching
it to the exception after it has been created.
Make tests a bit faster

We still do the same thing, but we don't create all repositories for each
test, since some tests only need a single repository. This will speed up
the test from e.g. 18 seconds to 7-8 seconds total walltime.
Do not rely on SUBMIN_ENV, set it ourselves.

Running the tests was impossible without setting SUBMIN_ENV, which is
an unwanted dependency. This is because c_apacheconf needs to include
'options' to get the basedir for templates, but we don't actually need
it for these tests (yet!).

So for now, we create a directory, put settings.py with the content in it,
but we don't actually need to create an SQLite db, because it's not accessed
at all. Also, we set the environment variable to the created directory.

This directory is basically a submin-env mock, but on disk. Newer tests may
need more, but we can always add files/dirs to the mock, or possibly just
run s-a initenv (but that will trigger an email to be sent, so that might not
be a nice option).
Speed up trac testing

Do not test if trac env can be created (it's super slow, and actually
we test if we can run a command). Also skip tests if trac-admin cannot be
found (so other parts can be tested without trac).
Added tests for subminadmin c_config
Updated finding of unittest files

I have the feeling more tests are found and we don't need hackish
intermediate unittests.py files. We now add all unittests from the
main runtest.py file. A unittest file is defined as either:
 * unittests.py, OR
 * tests/*.py

More tests are run and coverage is higher now.
Allow for a default value in options.env_path()

When there is no value set for a certain key, it throws an exception if
accessed through options.env_path(). This is not always convenient, and
unexpected because you can supply a default value to options.value().
This patch adds a default value to env_path() as well.
Added a Mock VCS type

When adding features or testing, it can be a drag to install support for
either subversion or git (because you don't want to install apache/svn
or you don't want to create a new user, or any other reason). We now
have a Mock VCS type, that just creates a directory and does not do
anything else. Enable it in your environment by adding mock to
vcs_plugins.
Fix coverage and unittesting

Trac tests didn't work correctly. This wasn't found because they
were actually never run. Also coverage had some problems.

Coverage now includes -all- submin files, so coverage goes down quite
a bit (this is good, so we can see what kinds of tests we need for minimal
coverage).

The runtest.py didn't include the submin path correctly (didn't work in all
cases), so system files were tested instead of working dir files. This is now
fixed.

Files to be tested can now be reliably be passed on the command line. It is
not very efficient, but it is simple and fast enough for the amount files
in the submin directory.
Moved vcs-specific code to plugins (fixes #296)

By moving all vcs-specific code to the relevant plugins, there are less
hacks, resulting in cleaner code. Also, this gave us the opportunity to
handle the '.git' extension more consistently, hence the closing of the
ticket.

This change requires a database upgrade, making the database more
consistent with the code as well (no more '.git' extensions where the
repository is stored).

Generating a URL to access the VCS is now also done in the vcs plugin.

Some typos and style changes were fixed while cleaning up the code.
Provide hints when things go wrong

Let Submin administrators know that they should run diagnostics to find
common problems. This might save them from filing a bug or wasting lots
of time.
Don't show ssh-port if it is default
Fixed typo in password reset email
Make sure we use the dev submin modules

If sys.path is not set, and the user forgot to source dev/scripts/env, and
if submin is installed on the system, there will be no error, but the
bin/submin2-admin script will silently use the system modules instead of the
working directory modules.

We force the sys.path to the working directory so this will not happen.
Use templates for apacheconf (refs #363)

Still no apache 2.4 config files, but at least we generate everything with
templates. This makes the code look a lot cleaner, plus we can clean up other
things more easily.
Simplify code!

Preparing for generating apache 2.4 files as well as apache <2.4 files
(refs #363). The main function, _apache_conf_create(), is now much cleaner.

Some template files were renamed so the file names are more predictable and
can be generated.

Functionality has been removed:
 * interactive (was deprecated)
 * 'wsgi' and 'cgi' modes (instead of 'all') (was deprecated)
Create both apache 2.4 as <2.4 files (fixes #363)

The differences are taken care off by including the often repeated changes
and deciding there based on a template variable.
Fixed apacheconf unittests (refs #363)
Trac env creation is now vcs-specific (refs #362)

When a trac environment is created, it is not created as a subversion env.
Also, the specific components for the environments are enabled. As a bonus,
two other components are enabled as well: CommitTicketUpdater and
CommitTicketReferenceMacro. These two are used by the trac commit hook.