Move 'entity' classes into a separate file
Move extraction logic into separate file
Move convertExtension() to utils.lua
Make indexEntry function local to where it's needed
Construct anchor name inline; no need for function
Move prependPath() to utils