Moved some popup note related stuff into own file
Some new popup note handling code