Implement gzip support; split example into seperate file