Improved the API for the SegmentTree class.
Added a gitignore file.
Matrix exponentiation is no longer recursive.
Small fixes.