Clean up and add tests for eldoc