Recoded portals

Basically everything apart from implementation into the tardis by
@bliptec