Refactorings and curry

Added curry plugin.
Refactored both chain and once