fix issue 119
solution: the === operator in php checks on type as well. made a cast to int
some small performance improvements
more performance improvements, rewritten queries
Merge pull request #21 from ingmargoudt/master

fix issue 119