Major refactor, moved freeems stuff to a plugin and changed directory structure