Remove some unused javascript code

This is still in dire need of being rewritten.