Anyone living a flat will be given the chance to buy a share in their property under reforms planned by the end of the current parliament.