Merge pull request #21 from sarevok/master

unittests v1 and config changes
Moving back to ancient MVC approach (database handling change)
Broken: JSON management
Merge remote-tracking branch 'origin/master'

Conflicts:
	config.py
Flask-SQLAlchemy dependency added
Pagination of requests introduced
Pagination of requests introduced
pagination done better (request arguments instead of parameters)
json pagination added. Following hal standard http://tools.ietf.org/html/draft-kelly-json-hal-06

Fixes #22
worker use model instead of database directly.

Problem with destination checking detected. Left unsolved.
Old style db access expelled
use the metadata api for gettting metadata

metadata management should be distinct from the storage part
to allow other components, which are able to store richer metadata
than the storage solution, to be used.

The metadata.py should also be able to combine metadata from different
sources.

This first implementation takes metadata from the only available source,
the storage, which is, at the moment, irods.
send the full filesize info for range chunks

now also for multirange requests
fix creating directories

started a common.py with the function split_path.
this one works like os.path.split, but returns the last subdir
in case a directory (with a / at the end) was provided.
add coding style guideline to the readme
add installation instructions to the readme
correct code indentation in readme
remove #! and empty first line from all files
fix closing irods connections

Now the close_storage() function is called on every response return,
so a new connection will be required at the next call.

If no storage connection exists, the function does nothing.

I expect, but don't know for sure that the reason that it works now
is related to using stream_with_context in the output streaming.

The connection that is closed is the one in the request context and
is assumed to be the correct one.

Because it's called on teardown_request, connections will be closed
even if the request throws an exception (which didn't work before).
Profiler run added
-simpler installation procedure
-twistd remove from .md (as it requires additional packages)
-db_create script updated and added to installation