Scheduler controller and new tests for scheduler

Add new controller for scheduler for use instead of addJob
(it had strange semantics...). Rewritten tests for scheduler.
Changed scheduler methods to return promises instead of
using callbacks in order to achieve clearer code.
Scheduler createJob and splitJob

Reimplementation of these methods to conform
with the new tests.
Fixed malfunctioning tests

Error was actually passed to the done handler
causing the test to fail while it should in fact succeed.
Also, it is not necessary to catch an error in fail in some
cases as it shadows the information about where did the error occur.
Implemented method Scheduler.enqueueJob
Implemented Scheduler.removeJob
Added SlaveManager template

Basically, two methods are expected from SlaveManager from
Scheduler at this phase.
Hardcoded functions

Moved the implementation of server_function.js to job-types.js to
conform with the changes. The test have also been moved to a new place.

Added sum (which does simple adding of numbers) and count-primary
(copied implementation, added only the reducer to work properly).
Merge pull request #35 from blostic/PS_#32_immediate_validation

Ps #32 immediate validation
Split enqueueJob into two separate methods
Merge pull request #36 from blostic/JS_#28_scheduler_refactoring

Js #28 scheduler refactoring
Merge pull request #37 from blostic/JS_#31_available_functions

Hardcoded functions
Add socket.io dependency
SlaveManager: simple enqeue() implementation
Add SlaveManager enqueue() test
some fixes
Add debug mode for extra logging, some fixes
Test scenarios: empty task package, multiple slaves
Add SlaveManager.dequeue() tests
Implement SlaveManager.dequeue()
Adjust naming to match documentation