Modularizes API.
Merge pull request #61 from jmeas/restructure-api

Modularizes API.