increment version to 3.0-apple-SNAPSHOT
use a more consistent and understandable absolute value comparison. change division and modulo arithmetic to use binary search.
merge release 3.0 to master