add CLI, small improvements, small reorganisement