Tweaked documentation and added configurability. Expanded tests