added data analysis code, and moved some things into new directories