tests: added padding to each element

(fails right now)
fixed some padding/max/min-height/width problems
small refactoring
use one common positioning function
another small refactoring concerning the splitter

use internal object instead of multiple closure variables