const-correctness and some minor performance improvements.
Merge pull request #22 from supranove/master

const-correctness and some minor performance improvements.