Moved source into sub directories and used CMake

Signed-off-by: Stephen Cox <stephencoxmail@gmail.com>