Re-organised project in 'lib' and 'tools', moved CSV saving to the tools