Small code reorg and more doc
Merge pull request #1 from andypiper/andyp

Small code reorg and more doc