Remove some unused includes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23347 57a11ea4-9604-0410-9ed3-97b8803252fd
Remove gnc_build_book_path from swig interface file

It hasn't been used in guile since 2006

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23348 57a11ea4-9604-0410-9ed3-97b8803252fd
On file open, only destroy a previous session if really exists

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23349 57a11ea4-9604-0410-9ed3-97b8803252fd
Move state handling code to separate file and improve on it

- keep the state information in memory while gnucash is running
- upon saving the state, only delete those sections that will be
  recreated by the save_all_state function

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23350 57a11ea4-9604-0410-9ed3-97b8803252fd