Added thread-safe implementation; changed API to support two implementations.
Merge pull request #7 from joshlf13/master

Added thread-safe implementation; changed API to support two implementat...