Merge pull request #12 from cpacey/validation

Adding parameter validation
Test cleanup

- Use Sinon for mocking instead of doing it manually
- Tabs