Optimizer: add tests
Merge pull request #14 from summeragain/master

Optimizer: add tests