createTables split into two methods and tidied up a bit.
createTables refined to support foreign-key reference.
foreign keys are now working - but only for MySQL