Code tidy ups and dont require pyspatialite