cleanup and restructure

Migrating server, probe, and store code into a (better-structured) Agent
class and Document class.
Moved 'current' support into agent.js
Moved 'sample' support into agent.js.
Moved 'save' functionality (update dataitem via url) into agent.js