Bug 885680 - Adding subject management

First version of the patch, with some doubts to solve before merging commits and do a proper review.