Add horizontal barchart option

You can use a horizontal barchart by using the option `horizontal = true`. This fixes #110. Quite a lot of code had to be added to make this work. Please let me know if you think something should be handled differently. This also includes the fix I supplied in #447, since it was really small. So it fixes #382 as well.