[RFC] Rework learning mechanics, as per issue #613

First pass at reworking the XP/learning mechanics. Implements items 1 through 5, from issue #613.

Still needs a bit more work before a proper submission (such as UI updates), but I think that testing/balance feedback at this phase would be useful.

Not template-compatible, and only partially save-compatible, but the next couple batches of changes should be fully compatible.