include <algorithm> for std::swap

This avoids compile error on OS X 10.8 with libstdc++
Merge pull request #2 from springmeyer/patch-3

include <algorithm> for std::swap