Added newTweet function, improved sql queries, improved exception handling.