Remove legacy client and rework build system.

--HG--
rename : lib/CMakeLists.txt => src/CMakeLists.txt
Basic API for the new client.