APY-142 : Rewrite packiging code

Added also some documentation changes. There will still be stuff
to do on packaging.