Mydev

Some changes while I catch up a bit on 1.1
docblocks
unused global
simplify function since we are 5.3 in 1.1
move some strangling $db to subs
create new subs to do so, need to think about some sub rearrangement etc