tests: add cram dependency

Cram is a tool for testing command line programs:

  https://bitheap.org/cram/

This allows us to do whole-system testing of zpm.

Cram 0.6 doesn't support Python 3.2. I fixed this and made a pull
request for getting the fix into upstream, but until this happens we
can depend on my fork.
zpm: handle invocation with no subcommand

Invoking zpm under Python 3 resulted in

   $ zpm
   Traceback (most recent call last):
     File "/home/mg/src/zpm/.tox/py3/bin/zpm", line 27, in <module>
       args.func(args)
   AttributeError: 'Namespace' object has no attribute 'func'

The problem is that argparse returns an empty Namespace in Python 3
when none of the subparsers match -- subparsers are seen as optional
in Python 3, but not in Python 2.
setup: include templates as package_data

The templates were not packaged and thus also not installed. This
meant that running 'zpm new' failed with:

  jinja2.exceptions.TemplateNotFound: zar.yaml

The error only occurs if the zpm package is installed normally,
creating a link with 'pip install -e .' hides the error.

Versions of Python before 2.7 did not automatically included the files
listed in package_data in the MANIFEST. So we now list them there too.
commands: RuntimeError has no message attribute in Python 3

This would trigger the following traceback if one tried to run 'zpm
new foo' and foo/zapp.yaml already existed:

  $ python3 zpm new foo
  Traceback (most recent call last):
    File "/home/mg/src/zpm/zpmlib/commands.py", line 86, in new
      zappyaml = zpm.create_project(args.dir)
    File "/home/mg/src/zpm/zpmlib/zpm.py", line 52, in create_project
      return _create_zapp_yaml(location)
    File "/home/mg/src/zpm/zpmlib/zpm.py", line 72, in _create_zapp_yaml
      raise RuntimeError("'%s' already exists!" % filepath)
  RuntimeError: 'foo/zapp.yaml' already exists!

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "zpm", line 23, in <module>
      args.func(args)
    File "/home/mg/src/zpm/zpmlib/commands.py", line 88, in new
      print(err.message)
  AttributeError: 'RuntimeError' object has no attribute 'message'
bundle: only encode shlex.split arg on Python 2.x

Before, we would encode all str objects to bytes objects, and this
causes an error in Python 3:

  >>> shlex.split(b'foo bar baz')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.3/shlex.py", line 276, in split
      return list(lex)
    File "/usr/lib/python3.3/shlex.py", line 266, in __next__
      token = self.get_token()
    File "/usr/lib/python3.3/shlex.py", line 93, in get_token
      raw = self.read_token()
    File "/usr/lib/python3.3/shlex.py", line 121, in read_token
      nextchar = self.instream.read(1)
  AttributeError: 'bytes' object has no attribute 'read'
bundle: use io.BytesIO for tar.addfile in Python 3

In Python 2, tar.addfile works with StringIO, but in Python 3 it needs
a io.BytesIO object instead.
bundle: add system tests

These tests verify the behavior patched in 06aa7e094db1 and
c86d7b5cb868.
Merge pull request #88 from mgeisler/cram

Add cram tests for exercising zpm CLI