Fix pixel scalling and standardise DB

This is an awful commit and should've been pushed in different commits
but hum ho. This fixes pixel related issues, starts removing T.Pixel()
in favour of extended API functions (Point, Width, etc.) and
standardises DB access/use (with some kludginess)