support Fedora

 * Also integrates most of the changes from #156
Merge pull request #169 from bwalex/fedora-support

support Fedora