First big commit for rewriting the webos server-side library.
Fixing #191.