Gluster part 1

Changes not tested yet but i hope it's a good base for further work.

EDIT: Note the pull request is against gluster branch.