Code refactor

1. Remove clumcy pointer reference to database
2. Reorder PatRestHelper methods. Information providers on top. Procedures at bottom.