Use Language instead of file extension to choose live dev document type

Also, update ``Document`` language before reading file content.