Fixes and enhancements for Debian packages

Various fixes for build process, scripts rewrite, file system hierarchy changes.