Fixed file management concept

Any methods that make changes to json documents, only make changes the
the c++ objects themselves. The portfolio class now has methods which
take save any changes made to the actual files. This is more efficient
as several changes can be made before writing to file.