more manipulation.js fixes and cleanup