rename `index` to `root`

1. rename "index.py" to "root.py"
2. rename `Index` class to `Root` class
3. rename all "index" in names of functions and variables to "root"
move `db` into `contrib` as extensions
add "_compat.py", relocate `get_exception_detail`

1. add "_compat.py" to handle Python compatibility
2. move `get_exception_detail` from "utils.py" to "exceptions.py"
move "shared_schema.py" into "contrib/db"
readjust project structure

1. move "resource/core/*" into "resource"
2. move "contrib/framework" into "resource"
3. move "root.py" into "contrib"