Added a test file for agent.js, marked it in the package.json as script (npm test).

Refactored the code in agent.js.
Changed the version number in the package.json file due to the return values in the agent.js
file.

Extended the README.md file.
Forgot to add these files.