Split lib code into ui and cli directories.