Test cleanup

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