Adding Travis config, unit tests.

Fixes #1. Fixes #2.