WIP.
Major rework with simplified API.
Merge pull request #3 from miranetworks/new_api

New simplified API.