Made getPositions operate in parallel instead of synchronously.
Added library support for accepting affiliate fees on close.
Marked all library methods as readonly (they always should have been, I was just lazy before).
Factored the delegatedContract instantiator into a private method and gave it a name that makes it more clear that you shouldn't reuse it.
Created an integration test for closure.
Addressed a couple TODOs in the integration tests including writing a test for opening 1x leverage positions and doing setup/cleanup between each test.