Revert "Revert "Make setting parent bean faster""

This reverts commit 34f94a2beba53e9589d508414afa48ea7bf40934.
Revert "Revert "Also fixed unset().""

This reverts commit 3523e041d5b319c691867ae00e208ef8db3cd6d1.
Re-adding optimization and fixing issue #335.
Merge branch 'master' into RedBeanPHP3_5_X
Merge branch 'master' into RedBeanPHP3_5_X
Merge branch 'master' into RedBeanPHP3_5_X
Merge branch 'master' into RedBeanPHP3_5_X
Merge branch 'master' into RedBeanPHP3_5_X
Merge branch 'master' into RedBeanPHP3_5_X
Adding test for alias fix.
Multi Alias fix
Alias fix 2 for deletion, and test.
Stringify postgres return ID value to avoid unintended side-effect in storing same beans in list.
Merged with RB35