Removed ui from lib code

Created seperate build-target for library code (without main, ui)
Removed UI code from frameextractor.cpp
Unfixed the memory leak (TODO: merge fix back in)