Update Agent.swift

Changed the initializer structure, added a few more explicit methods (for usage outside of the class initializers!), added explicit success and failure blocks, added some documentation and typealias's