Reduce code duplication in Sam API

make Sam inherit from both SamHeader and SamBody to avoid the
duplication of code and simplify writer and all other APIs.

This closes issue #16