Added panel class and some cursor functionality + bugfixes