changes for Swift beta 4 compatibility

This was mostly just marking (nearly) everything as public. The other changes were the switch to using `stride()`, a `NSRange` subscript for `String`, and a few other minor syntax changes.