Tided cost calculator code to allow for better subclassing
Improved performance of form and calculator