swift-simulator: correct handling of prefix

Before, a request with prefix=foo and an object named foo/bar.txt
would result in '/bar.txt' being returned.

This is incorrect since Swift really returns 'foo/' in that case. In
general, objects and subdirs are always returned using their full
name, so we should not cut off the prefix like we did.
swift-simulator: only add a subdir once in listObjects

Before, we would add {subdir: 'foo/'} twice when a container had two
objects named foo/a.txt and foo/b.txt.
Merge pull request #68 from mgeisler/trailing-subdir-slash

swift-simulator: correct handling of prefix
swift-sim: move $httpBackend config into commit

This is in preparation for making the simulator a real Angular service
that can keep some persistent state.
swift-sim: make SwiftSimultor an Angular service

This makes the simulator a singleton for the test run. Instead of
repeatedly configuring $httpBackend, the backend is now configured
once at the test start and the response functions consult the current
this.containers and this.objects as needed to compute their responses.

This makes it much easier to examine the state of the simulator at
runtime since the state is visible instead of being hidden inside
$httpBackend.
swift-mock: remove now obsolete commit function

Now that we compute the responses on the fly, the commit function is
no longer needed.
swift-sim: make listObjects a method
swift-sim: make listContainers a method
swift-sim: make deleteObject a method
swift-sim: make putObject a method
swift-sim: whitespace
swift-mock: really enforce test isolation

The tests were not really isolated before -- a 'foo' container added
in one test was visible to later tests. We now reset the state when
the mock is loaded.
swift-mock: clear mock modules

Modules registered with addMockModule stay for the entire duration of
the test run. So when each test adds more and more mock modules, we
end up executing the code again and again.

We now clear the existing list of mock modules when the swift mock is
injected. The mock is then only loaded once. Furthermore, containers
and objects are then also only configured once.