Structure demo code into an R package.

This PR is merely a refactoring with no functional change. It adds a package structure to the code with minimum viable documentation and a Travis config.
gotcha. makes sense, but I think we're still required to do it :)
looks good to me now!