Passes CRAN check

- Many bug fixes
- Roxygen2 documentation
- Two examples in /inst directory