Pre-Twitter Migration Commit

Implemented javascript prompts in necessary areas. Added input
sanitation for certain db calls. Cleaned up some code. All major
features have now been implemented (except twitter login).