Added microposts controller, refactored some code.