Changes for Swift beta 5 compatibility

This commit is mainly to get everything working again - may need to
revisit things to use new functionality in beta 5
merged upstream changes
Merge pull request #11 from natecook1000/master

Changes for Swift beta 5 compatibility