Modules installer

This is a simple modules installer (can't handle multiple files, or requirements yet)

It connects to http://jaspermoduleshub.herokuapp.com/

I added a `walk_packages` on `brain.py` so that modules can be installed in subfolders.
Well, let's see how we'll use the module:
```Python
import modinstall

inst = modinstall.ModInstaller('some_module')
inst.install()
del inst

# Why not call install() in __init__(), so that we only need to do:
inst = modinstall.ModInstaller('some_module')
del inst

# Now that we got rid of calling the the install() method manually,
# why not also get rid of the `del statement` by making it a function?
modinstall.install('some_module')
```

I think that the last version is a lot cleaner. What happens inside the function is another matter, and I think that this can be improved, too, e.g. `metadata` is only used by `download_module()`, so why not call it inside the `download_module()` function body?

I just wrote some quick&dirty code to demonstrate how such a function could look like:
```Python
# -*- coding: utf-8-*-
# python stdlib
import os
import urllib
import tempfile
import shutil
import subprocess

# 3rd party modules
import requests
import pip.req

# jasper modules
import jasperpath

class ModuleInstallationError(Exception):
    pass

def install(module_name, install_location=jasperpath.PLUGIN_PATH):
    # Download the metadata
    url = "http://jaspermoduleshub.herokuapp.com/plugins/%s.json" % urllib.quote(module_name)
    r = requests.get(url)

    # Check if data has been downloaded correctly
    if not r.status_code == requests.codes.ok:
        raise ModuleInstallationError("Invalid module name '%s'" % module_name)
    metadata = r.json()

    # Parse Metadata
    try: 
        file_type = metadata['last_version']['file_type']
        file_url =  metadata['last_version']['file']
    except KeyError:
        raise ModuleInstallationError('Invalid metadata')    

    # Check install location
    path = os.path.join(install_location, module_name)
    if os.path.exists(path):
        raise ModuleInstallationError('Module folder already exists')
    if not os.access(jasperpath.PLUGIN_PATH, os.W_OK):
        raise ModuleInstallationError('Install location is not writable')

    # Do download in temp dir to avoid leaving an unclean install_location on error
    tmpdir = tempfile.mkdtemp()
    try:
        # Download the files
        if file_type == 'git':
            exitcode = subprocess.call(['git', 'clone', file_url, tmpdir])
            if exitcode != 0:
                raise ModuleInstallationError('git clone returned with non-zero exit status')
        elif file_type == 'file':
            fname = os.path
            try:
                urllib.urlretrieve(file_url, os.path.join(tmpdir, '__init__.py'))
            except IOError, urllib.ContentTooShortError:
                raise ModuleInstallationError('File could not be downloaded correctly')
        else:
            raise ModuleInstallationError('Invalid file type')

        # Check requirements
        req_file = os.path.join(tmpdir, 'requirements.txt')
        missing_reqs = []
        if os.access(req_file, os.R_OK):
            for req in pip.req.parse_requirements(req_file):
                if not req.check_if_exists():
                   missing_reqs.append(req)
        if len(missing_reqs) > 0:
            print("PIP requirements missing for module %s:" % module_name)
            for req in missing_reqs:
                print(" - %s" % req.name)

        # Everything went well, copy tmpdir to install_location
        shutil.copytree(tmpdir, path)

        # Done
        print("Installed '%s' to '%s'" % (module_name, path))
    finally:
        # Delete tmpdir anyway
        shutil.rmtree(tmpdir)

if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser(description='Jasper modules installer')
    parser.add_argument('module_name', nargs='*')
    parser.add_argument('--location', default=jasperpath.PLUGIN_PATH, help="The location to install the modules to")
    args = parser.parse_args()

    for module_name in args.module_name:
        install(module_name, install_location=args.location)

```