Refactor server and lib into separate folders.