Rewritten external interface, added integration spec. HUGE COMMIT.

TODO: Add integration spec for block usage.