Cleanups
Fixed curry2 fn (did not return anything).
Added constants file.
Fixed setup & teardown for functional tests.
Started refactoring server code to reduce complexity.