Added CLI and made tests work