Swift-2 branch merge

This branch reimplements the framework in Swift. This would be the 3rd time this framework has been implemented from scratch (porting as much code as possible).