Removed some useless functions, simplified the margin/gap possibilities, implemented (terrible) htile layout.
Moved prototypes and structs to own header file.