Classes version

Now uses python classes. Still not perfect organisation.