Multiple changes

- Added CMake build system.
- Added the license.
- Added an example.
Refactored the printing into separate function