added simple note support with note.txt in studydir, moved non-analysis code to the bottom