Finally working. Cache needs a rewrite, though. Signed-off-by: Luca Fulchir <luker@fenrirproject.org>