Remove the target_ram_count thing (I think it confuses more than anything else) and convert everything else to the new official API.
Merge in bug26307 and update.