Made a commonly used function inlinable/inlined
Used std implementation of binary search instead of rolling our own - improved runtime slightly during test, will see what travis says