converted README to markdown and some more minor code cleanup