Instantiate app only when needed

This patch instantiates the app only when it is needed. This will
allow the functional tests to run against an external marconi
server, without having to unnecessarily configure the cache_url.

Change-Id: I54e436e08bbe6d2f3e3a4643f687e1d3a1647bb0
Closes-Bug: #1285100
Merge "Instantiate app only when needed"