Tweeting functionality implemented. Some refactoring done as well.