Trying out some initial schema translation, together with splitting the schema into base and foreign key constraints.

Should probably rewrite this as object oreintated code using Moose at some point.