Added support for not exporting some tables

Added the ability to specify if you did not want to export some tables,
such as cache tables etc.
Also linqified and modernised some other pieces.