change session handler to native session
move capsule init to db singleton callback
change code to follow PSR-2