data import: lots of bug fixes but still work in progress
import bugfixes + use of prepared statements for import