Source preview optimization

1. rspec included
2. moved a fews things from javascript to views. included the company and topic field, and the options in the right top corner.


I do need some code review for this as I am not sure whether I should include so many html things in code. Please let me know if there are problems.