Made it a bit more library like.

Now everything's called in a reasonably friendly way.