Modified total return from null.

Switched the return from: return 'null'; to return '0.00';
Code reformat and security changes

Reformatted code to seperate what was pushed to the client, tried
getting keypair generation working (broken)