Use subproject for tests

Make tests more modular by allowing multiple targets, each in their own
subproject. This is the way upstream qt project works.
Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>