Add docs, internalize state, more test