UI framework harvested from krryn project and updated slightly