Fix up some typo and configure for testing.

I added some configuration for testing. The distributing is based on `tox`.

A variable name typo written by me was found in testing.

@lepture Please review it. Thanks.