Move Document/Version/Transaction/Index to document.rs and add tests