add some javadocs and reformat sources
Merge pull request #40 from martiner/docs

add some javadocs and reformat sources