Ripienaar-ization

- Big refactoring
- Fix Ubuntu support