Got rid of sql command dependencies, Added tmp dbtype conversion (closes #25, #19)