PERF: moved performance calculation out of inner loop

lazy loading for portfolio
less repeating in performance period updates
PERF: Only update the portfolio once per dt.

So that each reference to `.portfolio` in the algoscript,
cache the value of the portfolio, and mark the need for a new
value at the end of each dt in the tradesimulation loop.
Merge lazy loading of portfolio and related values.