[WIP][TASK] use database handle

this is just the beginning of replacing all calls to TYPO3 db with a local
instance

Releases: master, 1.9
Change-Id: I1b3c9c961f421bd10d6bf7f0ada51777b8da23ef
Reviewed-on: http://review.typo3.org/34227
Reviewed-by: Simon Schaufelberger <simonschaufi@googlemail.com>
Tested-by: Simon Schaufelberger <simonschaufi@googlemail.com>